.class final Lcom/greystripe/sdk/m;
.super Ljava/lang/Object;


# instance fields
.field final synthetic a:Lcom/greystripe/sdk/c;


# direct methods
.method private constructor <init>(Lcom/greystripe/sdk/c;)V
    .locals 0

    iput-object p1, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method synthetic constructor <init>(Lcom/greystripe/sdk/c;B)V
    .locals 0

    invoke-direct {p0, p1}, Lcom/greystripe/sdk/m;-><init>(Lcom/greystripe/sdk/c;)V

    return-void
.end method

.method private a(Ljava/lang/String;)Lcom/greystripe/sdk/q;
    .locals 12

    const/4 v11, 0x2

    const/4 v1, 0x1

    const/4 v5, 0x0

    new-instance v3, Lcom/greystripe/sdk/q;

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-direct {v3, v0, v5}, Lcom/greystripe/sdk/q;-><init>(Lcom/greystripe/sdk/c;B)V

    const-string v0, ".*:\\{.*\\}"

    invoke-virtual {p1, v0}, Ljava/lang/String;->matches(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "no mathcey!"

    new-array v1, v5, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    move-object v0, v3

    :goto_0
    return-object v0

    :cond_0
    const-string v0, "{"

    invoke-virtual {p1, v0}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v0

    add-int/lit8 v0, v0, 0x1

    const-string v2, "}"

    invoke-virtual {p1, v2}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v2

    invoke-virtual {p1, v0, v2}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    const-string v2, "\\|"

    invoke-virtual {v0, v2}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v6

    array-length v7, v6

    move v4, v5

    :goto_1
    if-ge v4, v7, :cond_4

    aget-object v0, v6, v4

    invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v0

    const-string v2, ":"

    invoke-virtual {v0, v2}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v8

    aget-object v9, v8, v5

    array-length v0, v8

    if-le v0, v11, :cond_2

    const-string v0, ""

    move-object v2, v0

    move v0, v1

    :goto_2
    array-length v10, v8

    add-int/lit8 v10, v10, -0x1

    if-ge v0, v10, :cond_1

    new-instance v10, Ljava/lang/StringBuilder;

    invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v10, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    aget-object v10, v8, v0

    invoke-virtual {v2, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v10, ":"

    invoke-virtual {v2, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    add-int/lit8 v0, v0, 0x1

    goto :goto_2

    :cond_1
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    array-length v2, v8

    add-int/lit8 v2, v2, -0x1

    aget-object v2, v8, v2

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    aput-object v0, v8, v1

    :cond_2
    array-length v0, v8

    if-lt v0, v11, :cond_3

    aget-object v0, v8, v1

    invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v3, v9, v0}, Lcom/greystripe/sdk/q;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :cond_3
    add-int/lit8 v0, v4, 0x1

    move v4, v0

    goto :goto_1

    :cond_4
    move-object v0, v3

    goto :goto_0
.end method

.method private a(Landroid/content/Intent;Ljava/lang/String;)V
    .locals 4

    if-nez p1, :cond_0

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-virtual {v0}, Lcom/greystripe/sdk/c;->c()V

    :goto_0
    return-void

    :cond_0
    :try_start_0
    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->o(Lcom/greystripe/sdk/c;)Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0, p1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    const-string v1, "Greystripe"

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    aput-object p2, v2, v3

    invoke-static {v1, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-virtual {v0}, Lcom/greystripe/sdk/c;->c()V

    goto :goto_0
.end method

.method private b(Ljava/lang/String;)Landroid/content/Intent;
    .locals 14

    const/4 v13, 0x4

    const/4 v2, 0x0

    new-instance v3, Landroid/content/Intent;

    const-string v0, "android.intent.action.INSERT"

    invoke-direct {v3, v0}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-direct {p0, p1}, Lcom/greystripe/sdk/m;->a(Ljava/lang/String;)Lcom/greystripe/sdk/q;

    move-result-object v4

    invoke-virtual {v4}, Lcom/greystripe/sdk/q;->size()I

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return-object v0

    :cond_0
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "firstName"

    invoke-virtual {v4, v1}, Lcom/greystripe/sdk/q;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v0, "lastName"

    invoke-virtual {v4, v0}, Lcom/greystripe/sdk/q;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_2

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v5, " "

    invoke-direct {v0, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v5, "lastName"

    invoke-virtual {v4, v5}, Lcom/greystripe/sdk/q;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v0, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    :goto_1
    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    const-string v0, "phone"

    invoke-virtual {v4, v0}, Lcom/greystripe/sdk/q;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    const-string v0, "email"

    invoke-virtual {v4, v0}, Lcom/greystripe/sdk/q;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    const-string v0, "company"

    invoke-virtual {v4, v0}, Lcom/greystripe/sdk/q;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    const-string v0, ""

    const/4 v1, 0x5

    new-array v9, v1, [Ljava/lang/String;

    const-string v1, "street"

    aput-object v1, v9, v2

    const/4 v1, 0x1

    const-string v10, "city"

    aput-object v10, v9, v1

    const/4 v1, 0x2

    const-string v10, "state"

    aput-object v10, v9, v1

    const/4 v1, 0x3

    const-string v10, "zip"

    aput-object v10, v9, v1

    const-string v1, "country"

    aput-object v1, v9, v13

    const-string v10, ", "

    move v1, v2

    :goto_2
    array-length v11, v9

    if-ge v1, v11, :cond_3

    aget-object v11, v9, v1

    invoke-virtual {v4, v11}, Lcom/greystripe/sdk/q;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/String;->length()I

    move-result v12

    if-lez v12, :cond_1

    new-instance v12, Ljava/lang/StringBuilder;

    invoke-direct {v12}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v12, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    :cond_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_2

    :cond_2
    const-string v0, ""

    goto :goto_1

    :cond_3
    const-string v1, ", "

    invoke-virtual {v0, v1}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_4

    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v1

    invoke-virtual {v10}, Ljava/lang/String;->length()I

    move-result v9

    sub-int/2addr v1, v9

    invoke-virtual {v0, v2, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    :cond_4
    const-string v1, "fax"

    invoke-virtual {v4, v1}, Lcom/greystripe/sdk/q;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "url"

    invoke-virtual {v4, v2}, Lcom/greystripe/sdk/q;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    const-string v4, "vnd.android.cursor.dir/raw_contact"

    invoke-virtual {v3, v4}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;

    const-string v4, "name"

    invoke-virtual {v3, v4, v5}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const-string v4, "email"

    invoke-virtual {v3, v4, v7}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const-string v4, "phone"

    invoke-virtual {v3, v4, v6}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const-string v4, "company"

    invoke-virtual {v3, v4, v8}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const-string v4, "postal"

    invoke-virtual {v3, v4, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const-string v0, "secondary_phone"

    invoke-virtual {v3, v0, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const-string v0, "secondary_phone_type"

    invoke-virtual {v3, v0, v13}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    const-string v0, "notes"

    invoke-virtual {v3, v0, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const/high16 v0, 0x1000

    invoke-virtual {v3, v0}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;

    move-object v0, v3

    goto/16 :goto_0
.end method

.method private c(Ljava/lang/String;)Landroid/content/Intent;
    .locals 12

    const/4 v1, 0x0

    new-instance v2, Landroid/content/Intent;

    const-string v0, "android.intent.action.EDIT"

    invoke-direct {v2, v0}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-direct {p0, p1}, Lcom/greystripe/sdk/m;->a(Ljava/lang/String;)Lcom/greystripe/sdk/q;

    move-result-object v3

    invoke-virtual {v3}, Lcom/greystripe/sdk/q;->size()I

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return-object v0

    :cond_0
    const-string v0, "title"

    invoke-virtual {v3, v0}, Lcom/greystripe/sdk/q;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    const-string v0, "location"

    invoke-virtual {v3, v0}, Lcom/greystripe/sdk/q;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const-string v0, "notes"

    invoke-virtual {v3, v0}, Lcom/greystripe/sdk/q;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    const-string v0, "url"

    invoke-virtual {v3, v0}, Lcom/greystripe/sdk/q;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    const-string v0, "timeZone"

    invoke-virtual {v3, v0}, Lcom/greystripe/sdk/q;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_3

    const-string v0, "timeZone"

    invoke-virtual {v3, v0}, Lcom/greystripe/sdk/q;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/util/TimeZone;->getTimeZone(Ljava/lang/String;)Ljava/util/TimeZone;

    move-result-object v0

    :goto_1
    new-instance v8, Ljava/text/SimpleDateFormat;

    const-string v9, "MM/dd/yyyy HH:mm"

    invoke-direct {v8, v9}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V

    invoke-virtual {v8, v0}, Ljava/text/SimpleDateFormat;->setTimeZone(Ljava/util/TimeZone;)V

    const-string v0, "startDate"

    invoke-virtual {v3, v0}, Lcom/greystripe/sdk/q;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;

    move-result-object v9

    :try_start_0
    invoke-virtual {v8, v0}, Ljava/text/SimpleDateFormat;->parse(Ljava/lang/String;)Ljava/util/Date;

    move-result-object v10

    invoke-virtual {v9, v10}, Ljava/util/Calendar;->setTime(Ljava/util/Date;)V
    :try_end_0
    .catch Ljava/text/ParseException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_2
    const-string v0, "endDate"

    invoke-virtual {v3, v0}, Lcom/greystripe/sdk/q;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;

    move-result-object v10

    :try_start_1
    invoke-virtual {v8, v0}, Ljava/text/SimpleDateFormat;->parse(Ljava/lang/String;)Ljava/util/Date;

    move-result-object v8

    invoke-virtual {v10, v8}, Ljava/util/Calendar;->setTime(Ljava/util/Date;)V
    :try_end_1
    .catch Ljava/text/ParseException; {:try_start_1 .. :try_end_1} :catch_1

    :goto_3
    const-string v0, "allDay"

    invoke-virtual {v3, v0}, Lcom/greystripe/sdk/q;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    const-string v8, "t"

    invoke-virtual {v0, v8}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_1

    const-string v0, "allDay"

    invoke-virtual {v3, v0}, Lcom/greystripe/sdk/q;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    const-string v3, "y"

    invoke-virtual {v0, v3}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_4

    :cond_1
    const/4 v0, 0x1

    :goto_4
    const-string v1, "vnd.android.cursor.item/event"

    invoke-virtual {v2, v1}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;

    const/high16 v1, 0x1000

    invoke-virtual {v2, v1}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;

    const-string v1, "beginTime"

    invoke-virtual {v9}, Ljava/util/Calendar;->getTimeInMillis()J

    move-result-wide v8

    invoke-virtual {v2, v1, v8, v9}, Landroid/content/Intent;->putExtra(Ljava/lang/String;J)Landroid/content/Intent;

    const-string v1, "title"

    invoke-virtual {v2, v1, v4}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const-string v1, "description"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v3, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "\n"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v1, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const-string v1, "eventLocation"

    invoke-virtual {v2, v1, v5}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const-string v1, "allDay"

    invoke-virtual {v2, v1, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    if-nez v0, :cond_2

    const-string v0, "endTime"

    invoke-virtual {v10}, Ljava/util/Calendar;->getTimeInMillis()J

    move-result-wide v3

    invoke-virtual {v2, v0, v3, v4}, Landroid/content/Intent;->putExtra(Ljava/lang/String;J)Landroid/content/Intent;

    :cond_2
    move-object v0, v2

    goto/16 :goto_0

    :cond_3
    invoke-static {}, Ljava/util/TimeZone;->getDefault()Ljava/util/TimeZone;

    move-result-object v0

    goto/16 :goto_1

    :catch_0
    move-exception v10

    new-instance v10, Ljava/lang/StringBuilder;

    const-string v11, "Cannot parse startDate string: "

    invoke-direct {v10, v11}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v10, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    new-array v10, v1, [Ljava/lang/Object;

    invoke-static {v0, v10}, Lcom/greystripe/sdk/bd;->e(Ljava/lang/String;[Ljava/lang/Object;)V

    goto/16 :goto_2

    :catch_1
    move-exception v8

    new-instance v8, Ljava/lang/StringBuilder;

    const-string v11, "Cannot parse endDate string: "

    invoke-direct {v8, v11}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v8, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    new-array v8, v1, [Ljava/lang/Object;

    invoke-static {v0, v8}, Lcom/greystripe/sdk/bd;->e(Ljava/lang/String;[Ljava/lang/Object;)V

    goto/16 :goto_3

    :cond_4
    move v0, v1

    goto/16 :goto_4
.end method


# virtual methods
.method public final onAdExpired()V
    .locals 2
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->f(Lcom/greystripe/sdk/c;)Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->p(Lcom/greystripe/sdk/c;)Z

    move-result v0

    if-eqz v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    const-string v0, "onAdExpired"

    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->y(Lcom/greystripe/sdk/c;)Z

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->z(Lcom/greystripe/sdk/c;)V

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    sget-object v1, Lcom/greystripe/sdk/GSAdErrorCode;->AD_EXPIRED:Lcom/greystripe/sdk/GSAdErrorCode;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/c;->a(Lcom/greystripe/sdk/c;Lcom/greystripe/sdk/GSAdErrorCode;)V

    goto :goto_0
.end method

.method public final onAdReady()V
    .locals 2
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->f(Lcom/greystripe/sdk/c;)Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->p(Lcom/greystripe/sdk/c;)Z

    move-result v0

    if-eqz v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    const-string v0, "onAdReady"

    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->c(Lcom/greystripe/sdk/c;)Z

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->q(Lcom/greystripe/sdk/c;)Z

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->r(Lcom/greystripe/sdk/c;)V

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->g(Lcom/greystripe/sdk/c;)Z

    move-result v0

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->h(Lcom/greystripe/sdk/c;)V

    goto :goto_0

    :cond_2
    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->s(Lcom/greystripe/sdk/c;)Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->h(Lcom/greystripe/sdk/c;)V

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->j(Lcom/greystripe/sdk/c;)Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->k(Lcom/greystripe/sdk/c;)V

    goto :goto_0
.end method

.method public final onBlankThirdPartyAd()V
    .locals 2
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->A(Lcom/greystripe/sdk/c;)Z

    new-instance v0, Lcom/greystripe/sdk/n;

    invoke-direct {v0, p0}, Lcom/greystripe/sdk/n;-><init>(Lcom/greystripe/sdk/m;)V

    invoke-static {v0}, Lcom/greystripe/sdk/bm;->a(Ljava/lang/Runnable;)Z

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->a(Lcom/greystripe/sdk/c;)Lcom/greystripe/sdk/aa;

    move-result-object v0

    invoke-virtual {v0}, Lcom/greystripe/sdk/aa;->a()V

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->e(Lcom/greystripe/sdk/c;)V

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    sget-object v1, Lcom/greystripe/sdk/GSAdErrorCode;->NO_AD:Lcom/greystripe/sdk/GSAdErrorCode;

    invoke-virtual {v0, v1}, Lcom/greystripe/sdk/c;->a(Lcom/greystripe/sdk/GSAdErrorCode;)V

    return-void
.end method

.method public final onClickthrough(Ljava/lang/String;)V
    .locals 8
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    const/high16 v7, 0x1000

    const/4 v6, 0x1

    const/4 v5, 0x0

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->w(Lcom/greystripe/sdk/c;)Z

    move-result v0

    if-eqz v0, :cond_0

    const-string v0, "mraid ad was expanded. exec\'ing mraid.close"

    new-array v1, v5, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->a(Lcom/greystripe/sdk/c;)Lcom/greystripe/sdk/aa;

    move-result-object v0

    const-string v1, "mraid.close();"

    invoke-virtual {v0, v1}, Lcom/greystripe/sdk/aa;->b(Ljava/lang/String;)V

    :cond_0
    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->t(Lcom/greystripe/sdk/c;)Z

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->x(Lcom/greystripe/sdk/c;)V

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "Clicking through: "

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    new-array v1, v5, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    const-string v0, "sms:"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_2

    new-instance v2, Landroid/content/Intent;

    const-string v0, "android.intent.action.VIEW"

    invoke-direct {v2, v0}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    const-string v0, "\\?body="

    invoke-virtual {p1, v0}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v3

    const-string v1, ""

    const-string v0, ""

    if-eqz v3, :cond_1

    array-length v4, v3

    if-lez v4, :cond_1

    aget-object v1, v3, v5

    const-string v4, ":"

    invoke-virtual {p1, v4}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v4

    add-int/lit8 v4, v4, 0x1

    invoke-virtual {v1, v4}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v1

    array-length v4, v3

    if-le v4, v6, :cond_1

    aget-object v0, v3, v6

    :cond_1
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "sms:"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    invoke-virtual {v2, v1}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;

    const-string v1, "sms_body"

    invoke-virtual {v2, v1, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    invoke-virtual {v2, v7}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "Failed to send SMS "

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {p0, v2, v0}, Lcom/greystripe/sdk/m;->a(Landroid/content/Intent;Ljava/lang/String;)V

    :goto_0
    return-void

    :cond_2
    const-string v0, "contact:"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_3

    invoke-direct {p0, p1}, Lcom/greystripe/sdk/m;->b(Ljava/lang/String;)Landroid/content/Intent;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "Failed to save contact "

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {p0, v0, v1}, Lcom/greystripe/sdk/m;->a(Landroid/content/Intent;Ljava/lang/String;)V

    goto :goto_0

    :cond_3
    const-string v0, "calendar:"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_4

    invoke-direct {p0, p1}, Lcom/greystripe/sdk/m;->c(Ljava/lang/String;)Landroid/content/Intent;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "Failed to save calendar event "

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {p0, v0, v1}, Lcom/greystripe/sdk/m;->a(Landroid/content/Intent;Ljava/lang/String;)V

    goto :goto_0

    :cond_4
    :try_start_0
    invoke-static {p1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    new-instance v1, Landroid/content/Intent;

    const-string v2, "android.intent.action.VIEW"

    invoke-direct {v1, v2, v0}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    const/high16 v0, 0x1000

    invoke-virtual {v1, v0}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->o(Lcom/greystripe/sdk/c;)Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    const-string v1, "Greystripe"

    new-array v2, v6, [Ljava/lang/Object;

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "Failed to clickthrough to destination "

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    aput-object v3, v2, v5

    invoke-static {v1, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-virtual {v0}, Lcom/greystripe/sdk/c;->c()V

    goto :goto_0
.end method

.method public final onDismissal()V
    .locals 1
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->t(Lcom/greystripe/sdk/c;)Z

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->u(Lcom/greystripe/sdk/c;)Z

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0}, Lcom/greystripe/sdk/c;->v(Lcom/greystripe/sdk/c;)V

    return-void
.end method

.method public final saveImage(Ljava/lang/String;)V
    .locals 1
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    new-instance v0, Lcom/greystripe/sdk/o;

    invoke-direct {v0, p0, p1}, Lcom/greystripe/sdk/o;-><init>(Lcom/greystripe/sdk/m;Ljava/lang/String;)V

    invoke-virtual {v0}, Lcom/greystripe/sdk/o;->start()V

    return-void
.end method

.method public final setAdId(I)V
    .locals 2
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "setting adid: "

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    invoke-static {v0, p1}, Lcom/greystripe/sdk/c;->a(Lcom/greystripe/sdk/c;I)I

    return-void
.end method

.method public final setAdServerUrl(Ljava/lang/String;)V
    .locals 0
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    invoke-static {p1}, Lcom/greystripe/sdk/bj;->b(Ljava/lang/String;)V

    return-void
.end method

.method public final useCamera()V
    .locals 2
    .annotation runtime Landroid/webkit/JavascriptInterface;
    .end annotation

    iget-object v0, p0, Lcom/greystripe/sdk/m;->a:Lcom/greystripe/sdk/c;

    const/4 v1, 0x1

    iput-boolean v1, v0, Lcom/greystripe/sdk/c;->b:Z

    return-void
.end method
